package com.tian.core.beans;




import com.tian.core.lang.Constant;

import java.io.Serializable;

/**
 * 返回对象包装类(带泛型)
 * @author YangTao
 * @date 2025/4/18
 */

public class ResultBean<T> implements Serializable {
    private static final long serialVersionUID = 1L;
    private String respMsg = Constant.SUCCESS_RESP_MSG;
    private int respCode = Constant.SUCCESS_RESP_CODE;
    private T data;

    public ResultBean() {
    }

    public ResultBean(T data) {
        this.data = data;
    }

    public ResultBean(Throwable throwable) {
        this.respMsg = throwable.toString();
        this.respCode = Constant.ERROR_RESP_CODE;
    }

    public String getRespMsg() {
        return respMsg;
    }

    public void setRespMsg(String respMsg) {
        this.respMsg = respMsg;
    }

    public int getRespCode() {
        return respCode;
    }

    public void setRespCode(int respCode) {
        this.respCode = respCode;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
